# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=flask-session-cookie-manager
pkgname=('flask-session-cookie-manager3' 'flask-session-cookie-manager2')
pkgver=v1.2.2.r1.g3c271d2
pkgrel=1
pkgdesc='Decode and encode Flask session cookie.'
arch=('any')
groups=('blackarch' 'blackarch-webapp')
url='https://noraj.github.io/flask-session-cookie-manager/'
license=('MIT')
makedepends=('git')
source=("git+https://github.com/noraj/$pkgbase.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgbase

  git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

package_flask-session-cookie-manager3() {
  depends+=('python' 'python-itsdangerous' 'python-flask')

  cd $pkgbase

  install -Dm 644 -t "$pkgdir/usr/share/doc/${pkgbase}3/" README.md
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/${pkgbase}3/LICENSE"

  install -Dm 755 flask_session_cookie_manager3.py "$pkgdir/usr/bin/${pkgbase}3"
}

package_flask-session-cookie-manager2() {
  depends+=('python2' 'python2-itsdangerous' 'python2-flask')

  cd $pkgbase

  install -Dm 644 -t "$pkgdir/usr/share/doc/${pkgbase}2/" README.md
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/${pkgbase}2/LICENSE"

  install -Dm 755 flask_session_cookie_manager2.py "$pkgdir/usr/bin/${pkgbase}2"
}

